package com.nova.edc.dao.system.impl;

import com.nova.edc.dao.system.LoginDao;
import com.nova.edc.model.system.Login;
import com.nova.frame.dao.buzz.JdbcBaseDAO;
import com.nova.frame.dao.criterion.Restrictions;

public class LoginDaoImpl extends JdbcBaseDAO<Login, String> implements
		LoginDao {

	@Override
	public int getExtCount() {
		return query().add(Restrictions.eq("t_login.Scrapped", 0)).list().size();
	}

	@Override
	public int deleteById(int id) {
		Login login = getById(String.valueOf(id));
		login.setScrapped(1);
		return update(login);
	}

}
